package com.xinkao.example.config;


import io.minio.MinioClient;
import lombok.Data;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * minio
 * @Author lililiang
 * @Date 2021/7/9 10:53
 */
@Data
@Configuration
public class MinioConfig {

	@Bean
	@SneakyThrows(Exception.class)
	public MinioClient minioClient( @Value("${minio.server}")  String server,
									@Value("${minio.access_key}")  String access,
									@Value("${minio.secret_key}")  String secret){
		return new MinioClient(server, access, secret);
	}

}
